Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data.SqlHelper
Public Class SilosDeMP
    Public Function ObtenerDisponiblesPorGrano(ByVal Cod_Grano As Integer)
        Dim DS As New DataSet
        DS = ExecuteDataset(My.Settings.MiCadena, CommandType.StoredProcedure, "SilosMPDisponiblesObtenerPorGrano", New SqlParameter("@Cod_Grano", Cod_Grano))
        Return DS
    End Function

    Public Function Controlar(ByVal Silo1 As Integer)
        Dim Silo As Integer
        Silo = ExecuteScalar(My.Settings.MiCadena, CommandType.StoredProcedure, "SilosMPControlar", New SqlParameter("@Silo", silo1))
        Return Silo
    End Function

    Public Function Insertar(ByVal PesoNeto As Integer, ByVal Clasificacion As Integer)
        Dim I As Integer
        I = ExecuteScalar(My.Settings.MiCadena, CommandType.StoredProcedure, "SilosMPInsertar", New SqlParameter("@PesoNeto", PesoNeto), New SqlParameter("@Clasificacion", Clasificacion))
        Return I
    End Function

    Public Function AgregarPeso(ByVal Codigo As Integer, ByVal Peso As Integer)
        Dim PesoResultante As Integer
        PesoResultante = ExecuteScalar(My.Settings.MiCadena, CommandType.StoredProcedure, "SilosMPAgregarPeso", New SqlParameter("@Codigo", Codigo), New SqlParameter("@PesoAgregado", Peso))
        Return PesoResultante
    End Function

End Class
